<!DOCTYPE html>
<html>
<head>
	<title>
	</title>
</head>
<body>
	<canvas id="canvas" width ="500" height="500" style="border:1px solid #000">
		
	</canvas>

</body>
</html>

<script type="text/javascript">
	var canvas = document.getElementById('canvas');
	var context = canvas.getContext('2d');
	var gr = context.createRadialGradient(400,50,40,400,50,400);
	gr.addColorStop(0,'rgb(255,255,0')
	gr.addColorStop(0.5,'rgb(255,0,255)')
	gr.addColorStop(1,'rgb(0,255,255)')
	context.fillStyle = gr
	context.fillRect(0,0,500,500)
	
	//圆形渐变//


</script>